package com.example.demo.mapper;


import com.example.demo.entity.Price;
import com.example.demo.entity.article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
@Repository
public interface articleMapper {

    public List<article> selectall();

    public Integer addArticle(@Param("name") String name,@Param("title") String title,@Param("content") String content,@Param("userName") String userName,@Param("userId") String userId,@Param("dateTime") LocalDateTime dateTime,@Param("img") String img);

    public Integer updateArticle(@Param("content")String content,@Param("id")Integer id);

    /**
     * 查看指定文章
     * @param id 文章的编号
     * @return
     */
    public article selectUser(@Param("id")Integer id);

    /**
     * 根据文章 类型 查询 name 为文章 类型
     */
    public List<article> selectname(@Param("name")String name);


    public Price selectPrice(@Param("id") Integer id);

}
